/*
 * @Author: szx
 * @Date: 2022-03-28 13:44:57
 * @LastEditTime: 2022-03-28 13:52:43
 * @Description:
 * @FilePath: \leetcode\剑指offer\56\56_II.js
 */
/**
 * @param {number[]} nums
 * @return {number}
 */
var singleNumber = function (nums) {
    let res = 0,
        bit = 0;
    for (let i = 30; i >= 0; i--) {
        for (let n of nums) {
            bit += (n >> i) & 1;
        }
        res <<= 1;
        res += bit % 3;
        bit = 0;
    }
    return res;
};
